<div class="item entry" id="main-1">
<div class="itemhead">
<h3>Add New Article</h3>
</div>
<div class="storycontent">
<form name="f1" id="mainform" action="<?php echo $this->baseUrl ?>/article/add" method="post">
<div>
<label for="title">Title</label><br />
<input type="text" name="title" size="60"
value="<?php echo $this->escape($this->obj->title);?>" />
</div>
<div>
<label for="url_title">Url Title</label><br />
<input type="text" name="url_title"  size="60"
value="<?php echo $this->escape($this->obj->url_title);?>" />
</div>

<div>
<label for="tags">Tags</label><br />
<input type="text" name="tags" size="60"
value="<?php echo $this->escape($this->tags);?>" />
</div>
<div>
    <label for="introtext">Introduction</label><br />
	<textarea name="introtext" id="introtext" cols="150" rows="10">
<?php echo $this->escape($this->obj->introtext);?>
	</textarea>
</div>
<div>
    <label for="complete_text">Complete Text</label><br />
	<textarea name="complete_text" id="complete_text" cols="10" rows="10">
<?php echo $this->escape($this->obj->complete_text);?>
	</textarea>
</div>
<div id="formbutton">
<input type="submit" name="addButton" value="Add"/><input type="reset" name="reset" value="Clear Form" />
</div>
</form>
</div></div>
<script  type="text/javascript">
var myEditor1 = new YAHOO.widget.Editor('complete_text', {
    height: '300px',
    width: '550px',
    animate: true
});
myEditor1.render();

var myEditor2 = new YAHOO.widget.Editor('introtext', {
    height: '300px',
    width: '550px',
    animate: true
});
myEditor2.render();

YAHOO.util.Event.on('mainform', 'submit', function(ev) {
	YAHOO.util.Event.stopEvent(ev);
	myEditor1.saveHTML(); //Save the HTML
	var e_data1 = myEditor1.get('textarea').value;
	myEditor1.get('textarea').value = e_data1;
	myEditor2.saveHTML(); //Save the HTML
	var e_data2 = myEditor2.get('textarea').value;
	myEditor2.get('textarea').value = e_data2;
	YAHOO.util.Dom.get('mainform').submit();
});
</script>
